from direct.showbase.ShowBase import ShowBase
from panda3d.core import loadPrcFileData

# 配置窗口大小
loadPrcFileData("", "win-size 800 600")

class MyApp(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)

        # 加载 3D 模型
        self.model = self.loader.loadModel("models/smiley")
        self.model.reparentTo(self.render)

        # 设置模型位置
        self.model.setPos(0, 10, 0)

        # 设置相机位置
        self.camera.setPos(0, -20, 10)
        self.camera.lookAt(self.model)

# 运行程序
app = MyApp()
app.run()